
<?php if(Yii::app()->user->isGuest){?>
<table>
	<tr class='header-table'>
		<th width='50%'><?php echo $nhom->tennhom; ?></th>
		<th width='15%'> <div align='center'>Price</div></th>
		<th width='15%'> <div align='center'>Type</div> </th>
		<th width='15%'> <div align='center'>Time</div> </th>
	</tr>
	<?php 
	foreach ($nhom->tbdichvus as $dichvu) {
		if($dichvu->trangthai == 0){
			continue;
		}
		
		
		?>
	
		
	<tr class='row-table'>
		<td> <?php echo CHtml::link( $dichvu->tendichvu, array('dichvu/muadichvu', 'id'=>$dichvu->id)); ?>
		</td>
		<td><div align='center'> <?php  echo $dichvu->gia; ?></div> </td>
		<td><div align='center'> <?php echo $dichvu->loaicode; ?></div> </td>
		<td><div align='center'> <?php echo $dichvu->thoigian; ?></div> </td>
	</tr>	
	<?php 
	}
	?>

</table>

<?php }else{
	$criteria = new CDbCriteria();
	$criteria->compare('iduser', UserUtils::getUserId());
	$listgiauser = GiadichvuUser::model()->findAll($criteria);
?>

<table>
	<tr class='header-table'>
		<th width='50%'><?php echo $nhom->tennhom; ?></th>
		<th width='8%'> <div align='center'>Price</div></th>
		<th width='12%'> <div align='center'>Price User</div></th>
		<th width='15%'> <div align='center'>Type</div> </th>
		<th width='25%'> <div align='center'>Time</div> </th>
	</tr>
	<?php 
	foreach ($nhom->tbdichvus as $dichvu) {
		if($dichvu->trangthai == 0){
			continue;
		}
		
		
		?>
	
		
	<tr class='row-table'>
		<td> <?php echo CHtml::link( $dichvu->tendichvu, array('dichvu/muadichvu', 'id'=>$dichvu->id)); ?>
		</td>
		 <td><div align='center'> <?php  echo $dichvu->gia; ?></div> </td>
		 <td><div align='center'>
		 <?php
		 foreach ($listgiauser as $gia){
		 	if($gia->iddichvu == $dichvu->id){
		 		echo  $gia->gia;
		 		break;
		 	}
		 } 
		 ?>
		 </div> </td>
		<td><div align='center'> <?php echo $dichvu->loaicode; ?></div> </td>
		<td><div align='center'> <?php echo $dichvu->thoigian; ?></div> </td>
	</tr>	
	<?php 
	}
	?>

</table>


<?php }?>